<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2017/9/11
 * Time: 15:33
 */

defined('InNcPHP') or exit('Access Invalid!');

class bargain_linkControl  extends  SystemControl{

    public  function __construct()
    {
        parent::__construct();
        Language::read('bargain_link');
    }

    public  function  indexOp(){
        $model = Model('');
        $data =$model->table('bargain_link')->find();
        if(chksubmit()){
            $result = array();
            $result['link_title'] = $_POST['link_title'];
            $result['link_url'] = $_POST['link_url'];

            if(empty($data)){
                $model->table('bargain_link')->insert($result);
            }else{
                $model->table('bargain_link')->where(array('id'=>$data['id']))->update($result);
            }
            showMessage(L('nc_common_save_succ'));
        }
        Tpl::output('link_info',$data);
        Tpl::showpage('bargain_link');

    }


}